<?php

class Application_Form_Kontakt extends Zend_Form {

    public function init() {
        $this->addElement('text', 'sender', array(
            'label' => 'Imię i nazwisko:',
            'required' => true,
            'filters' => array(
                'StringTrim',
                'StripNewlines',
                'StripTags',
            ),
            'validators' => array(
                'NotEmpty',
                array('StringLength', false, array(5, 100)),
            )
        ));


        $this->addElement('text', 'email', array(
            'label' => 'Adres e-mail:',
            'required' => true,
            'filters' => array(
                'StringTrim',
                'StringToLower',
                'StripNewlines',
                'StripTags',
            ),
            'validators' => array(
                'EmailAddress',
                'NotEmpty',
            )
        ));

        $this->addElement('text', 'phone', array(
            'label' => 'Numer kontaktowy:',
            'required' => true,
            'filters' => array(
                'StringTrim',
                'StripNewlines',
                'StripTags',
            ),
            'validators' => array(
                'Alnum',
                array('StringLength', false, array(9, 20)),
            )
        ));

        $this->addElement('select', 'subject', array(
            'label' => 'Temat wiadomości:',
            'required' => true,
            'multioptions' => array(
                '' => 'Wybierz temat wiadomości',
                'Prośba o kontakt' => 'Prośba o kontakt',
                'Zapytanie' => 'Zapytanie',
                'Pomoc' => 'Pomoc'
            ),
            'filters' => array(
                'StringTrim',
                'StripNewlines',
                'StripTags',
            ),
            'validators' => array(
                'NotEmpty',
            ),        
        ));

        $this->addElement('textarea', 'text', array(
            'label' => 'Treść wiadomości:',
            'required' => true,
            'attribs' => array(
                'cols' => 50,
                'rows' => 10
            ),
            'filters' => array(
                'StringTrim',
                'StripTags',
            ),
            'validators' => array(
                'NotEmpty',
                array('StringLength', false, array(5, 1000)),
            ),
        ));

        $this->addElement('captcha', 'captcha', array(
            'label' => 'Potwierdź autentyczność:',
            'required' => true,
            'captcha' => array(
                'captcha' => 'ReCaptcha',
                'privKey' => '6LeKx7sSAAAAAAeJCkcmBFujuzztBmqaoLjFtYUt',
                'pubKey' => '6LeKx7sSAAAAAHTd_3T13KOvHZgtygNUOax1H5E6'
            )
        ));

        $this->addElement('submit', 'wyślij');
    }

}